package com.accp.vehiclecare.dao.hzdao;

import com.accp.vehiclecare.vo.hzvo.Commodity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommodityMapper {
    int deleteByPrimaryKey(Integer commid);

    int insert(Commodity record);

    int insertSelective(Commodity record);

    Commodity selectByPrimaryKey(Integer commid);

    int updateByPrimaryKeySelective(Commodity record);

    int updateByPrimaryKey(Commodity record);

    List<Commodity> showlist(@Param("name")String name);

    @Delete("DELETE FROM `commodity` WHERE `commid`=#{id}")
    int delete(@Param("id")Integer id);


    @Insert("INSERT INTO `commodity` ( `incometypeid`, `countunitid`, `goodsid`, `commtypeid`,  `commno`, `commname`, `commcount`, `praddress`,  `cclass`, `cpricesl`, `vipprice`)" +
            " VALUES ( #{commodity.incometypeid},  #{commodity.countunitid},  #{commodity.goodsid},  #{commodity.commtypeid},  #{commodity.commno},  #{commodity.commname},  #{commodity.commcount},  #{commodity.praddress},  #{commodity.cclass},  #{commodity.cpricesl},  #{commodity.vipprice}); \n")
    int addsp(@Param("commodity")Commodity commodity);
}